Skip to content

ci(spec-sync): read specs from live staging instead of S3 - #136

Merged
tian-lan-landing merged 5 commits into
mainfrom
claude/spec-sync-staging-revert-236873
Jul 31, 2026
Merged

ci(spec-sync): read specs from live staging instead of S3#136
tian-lan-landing merged 5 commits into
mainfrom
claude/spec-sync-staging-revert-236873

Conversation

@tian-lan-landing

Copy link
Copy Markdown
Collaborator

Revert spec-sync's spec source from the S3 copy back to live staging (V1 api.va.staging, V2 aide.staging — both now public/no-auth).

Staging auto-reclaims, so an unreachable spec URL is now an expected no-op: the fetch-error step skips instead of failing (no PR, no Slack alert). The failure alert keeps only the AI-wiring/generic cases. Docs and comments updated.

🤖 Generated with Claude Code

Revert the V1/V2 spec source from the S3 copy back to live staging
(api.va.staging, aide.staging — both now public and fetchable without
auth). Since staging auto-reclaims and must be booked, an unreachable
spec URL is now the expected case: the fetch-error step skips (logs and
exits 0) instead of failing, so the run opens no PR and sends no Slack
alert. The failure alert now covers only AI-wiring and generic failures.
Docs and comments updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 30, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Switches spec-sync from S3 snapshots to live staging OpenAPI endpoints and treats unavailable staging environments as no-op runs.

Changes:

  • Uses live V1 and V2 staging spec URLs.
  • Skips failed spec fetches without Slack alerts.
  • Updates contributor and design documentation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/spec-sync.yml Updates spec sources and fetch-failure handling.
CONTRIBUTING.md Documents live staging synchronization.
docs/design/stainless-exit-and-v2.md Records unauthenticated spec availability.
Comments suppressed due to low confidence (2)

.github/workflows/spec-sync.yml:292

  • This skips every operational error, not just an unreachable staging host. check-drift.sh maps all non-0/10 failures together, so malformed JSON (jq failure), script regressions, and local filesystem errors now make the job succeed silently. Please give the expected curl-unavailable case a dedicated exit code and skip only that code; other failures should still fail and alert.
        if: steps.drift.outputs.code != '0' && steps.drift.outputs.code != '10'
        run: echo "spec fetch/normalize failed (exit ${{ steps.drift.outputs.code }}); staging is likely unbooked — skipping this run."

.github/workflows/spec-sync.yml:289

  • The release-safety claim is currently false: .github/workflows/release.yml never invokes scripts/spec-sync/release-gate.sh, as also documented in docs/design/v2-spec-sync-extension.md:96-106. This is especially relevant to V2 because the existing gate script only knows the V1 production URL and snapshot; remove this rationale unless both gates are wired.
      # the next hourly run picks up any drift once staging is booked, and the release gate reads the
      # always-online production spec, so releases are unaffected.

Comment thread .github/workflows/spec-sync.yml Outdated
Comment thread .github/workflows/spec-sync.yml Outdated
@tian-lan-landing tian-lan-landing added the breaking-change-approved Surface-lock override: a reviewed, intentional public-surface change label Jul 30, 2026
Address Copilot review. The previous skip treated every non-0/10 exit
from check-drift.sh as an expected no-op, silently swallowing a
reachable-but-empty/invalid spec, malformed JSON, or a script error.
Give the unreachable-source case a dedicated exit 20 in
fetch-normalize.sh (curl fetched separately from jq), and skip only
that; every other failure now falls through to a new "Fail on spec
error" step and fires the Slack alert. Also drop the incorrect note that
the (unwired) release gate keeps releases unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 30, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread scripts/spec-sync/fetch-normalize.sh Outdated
tian-lan-landing and others added 2 commits July 30, 2026 16:31
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ing-revert-236873

# Conflicts:
#	scripts/spec-sync/fetch-normalize.sh
Copilot AI review requested due to automatic review settings July 30, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

scripts/spec-sync/fetch-normalize.sh:15

  • curl -f fails for HTTP 4xx/5xx as well as transport errors, so this maps a reachable endpoint returning 401, 404, or 500 to exit 20. Both workflow jobs then treat those authentication/routing/service regressions as an expected no-op with no alert. Map only the transport failures expected for an unbooked cluster to 20 and make every other curl failure an operational error.
raw="$(curl -fsSL --max-time 30 --retry 3 --retry-delay 2 "$url")" || exit 20

…alert)

Address Copilot review on #136. `curl -f` collapsed every 4xx/5xx into a
single exit code, so this mapped an auth regression (401/403) and a
persistent 5xx server error to the same exit 20 as an unbooked cluster —
skipping them silently. fetch-normalize.sh now inspects the HTTP status:
a transport failure (DNS/refused/timeout) and a 404 (an unbooked staging
cluster's response — see the book-ade flow) exit 20 and are treated as
the expected no-op; any other non-200 (401/403/5xx), an empty/invalid
spec, or a script error exits non-20 and fires the Slack alert. Workflow
comments, check-drift.sh, and CONTRIBUTING.md updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 31, 2026 03:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

scripts/spec-sync/fetch-normalize.sh:18

  • This maps every curl failure to the expected-unavailable code, including certificate errors (60), malformed URLs (3), and local output/write failures (23). Those are configuration or runner errors, but both jobs will now succeed without the promised alert. Reserve exit 20 for the intended DNS/connect/timeout statuses and map other curl failures to an operational error.
code="$(curl -sS --max-time 30 --retry 3 --retry-delay 2 -o "$body" -w '%{http_code}' "$url")" || exit 20

@tian-lan-landing
tian-lan-landing merged commit 7e27bb0 into main Jul 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change-approved Surface-lock override: a reviewed, intentional public-surface change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants